import request from '@/utils/request.js'

// 获取仪表盘借阅趋势数据（最近7天）
export function getDashboardBorrowingTrend() {
  return request({
    url: '/admin/statistics/borrowing-trend',
    method: 'get'
  })
}

// 获取借阅趋势分析数据
export function getBorrowingTrend(timeUnit, compareType) {
  return request({
    url: `/admin/api/statistics/borrowing-trend/${timeUnit}/${compareType}`,
    method: 'get'
  })
}

// 获取图书分类占比
export function getCategoryProportion() {
  return request({
    url: '/admin/statistics/category/proportion',
    method: 'get'
  })
}

// 获取图书分类统计
export function getCategoryStats(params) {
  return request({
    url: '/admin/statistics/category/analysis',
    method: 'get',
    params
  })
}

// 获取热门图书
export function getPopularBooks(params) {
  return request({
    url: '/admin/api/statistics/popular-books',
    method: 'get',
    params
  })
}

// 获取热门图书TOP5
export function getPopularBooksTop5() {
  return request({
    url: '/admin/statistics/popular-booksTOP5',
    method: 'get'
  })
}

// 获取读者活跃度数据（本周）
export function getDashboardReaderBehavior() {
  return request({
    url: '/admin/statistics/reader-behavior',
    method: 'get'
  })
}

// 获取图书库存状态统计
export function getInventoryStatusStats(params) {
  return request({
    url: '/admin/statistics/inventory/status',
    method: 'get',
    params
  })
}

// 获取核心指标数据
export function getCoreMetrics() {
  return request({
    url: '/admin/statistics/dashboard/core-metrics',
    method: 'get'
  })
} 